#include "input_queue.h"
#include "FreeRTOS.h"
#include "queue.h"
#include <stdio.h>

static QueueHandle_t  input_queue;

int InputQueueInit(void)
{
    input_queue = xQueueCreate(HBUFFER_SIZE, sizeof(inputEvent));
    if(input_queue == NULL)
    {
        printf("Creat Queue Fail\r\n");
        return PDFAIL;
    }else
    {
        return PDSUCCESS;
    }
}


int PutInputEvent(pInputEvent target)
{
    xQueueSendFromISR(input_queue, target, NULL);
    return PDSUCCESS;
}


int GetInputEvent(pInputEvent target)
{
    xQueueReceive(input_queue, target, portMAX_DELAY);
    return PDSUCCESS;
}

